import storage from 'electron-json-storage'

export const RECENT_FILE_LIST = 'recentFileList'
export const CLIENT_CONFIG = 'client_config'
export const EDIT_WINDOW_SIZE = 'edit_window_size'


// 保存配置
export const saveClientConfig = config => {
  return new Promise((resolve, reject) => {
    storage.set(CLIENT_CONFIG, config, err => {
      if (err) {
        reject(err)
      } else {
        resolve()
      }
    })
  })
}

// 获取配置
export const getClientConfig = () => {
  const res = storage.getSync(CLIENT_CONFIG)
  return res
}
